/* 3 Columns - css grid */
#mainBody {
    display: grid;
    grid-template-columns: 250px 1fr 250px; 
    max-width: 1200px;
    width: 100%;
    gap: 20px;
    padding: 20px 10px;
    margin: 0 auto;
    flex-grow: 1;
}

/* Panels */
/*
    TODO MAKE THEM STICK TO THE LEFT AND RIGHT SIDES OF THE SCREEN
    No clue how to do that yet, cuz of the grid layout
*/
#leftPanel, #rightPanel {
    padding: 15px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#leftPanel {
    position: sticky; 
}

#rightPanel {
    position: sticky;
}


/* Posts */
#postList {
    padding: 0;
}

.post-card {
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); 
    
    margin-bottom: 20px;
    
    display: block; 
    width: 100%;
    box-sizing: border-box;
}

.post-avatar {
    width: 40px; 
    height: 40px;
    
    object-fit: cover;
    
    margin-right: 10px;
    
    border: 1px solid #ccc; 
}

/* Adjacent Sibling Selector usage */
.post-content img.post-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
}

.post-content + .post-actions {
    border-top: 1px solid rgba(0, 0, 0, 0.1); /* Тонкая линия разделитель */
    padding-top: 10px;
    margin-top: 10px;
}

.post-header {
    display: flex;        
    align-items: center;
    margin-bottom: 10px;
    
    justify-content: space-between; 
}

.post-info {
    flex-grow: 1; 
}

/* Usage of child selector */
.post-info > h4.post-author {
    color: #333;
    margin-top: 0;
    margin-bottom: 2px;
}

/* General Sibling Selector 
THE HELL IS THAT 
TODOOOOOOO
*/

.post-date {
    margin-left: auto;
    font-size: 0.85em;
    color: #606770;
    white-space: nowrap; 
}

/* Pseudo-element usage */
.post-date::before {
    content: ">";
    margin-right: 5px;
    margin-left: 5px;
    color: goldenrod;
    font-weight: normal;
}

.post-avatar {
    width: 40px; 
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

#postList .post-card:last-child {
    margin-bottom: 0;
}

footer {
    width: 100%;
    text-align: center;
    padding: 15px 0;
    color: #606770;
    font-size: 0.9em;
    border-top: 1px solid #ddd;
    background-color: rgba(0,0,0,0.2);
    border-radius: 30px;
}

/* Tablet */
@media (max-width: 1000px) {
    #rightPanel {
        display: none;
    }
}


/* Mobile */
@media (max-width: 768px) {
    #mainBody {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    #leftPanel, #rightPanel {
        display: none;
    }
    
    .post-container {
        width: 100%;
        max-width: 300px;
        margin: 25px auto;
    }

    textarea {
        width: 80%;
    }
}